import request from "@/utils/request2";
export function InsertSbdeice(purchasedetails) {
  return request({
    url: "/application/InsertPurchasedetails",
    method: "post",
    data: purchasedetails,
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

//采购申请新增
export function Insertkan(map) {
  return request({
    url: "/application/insert",
    method: "post",
    data: JSON.stringify(map),
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

//采购备件申请新增
export function InsertApplicationBei(map) {
  return request({
    url: "/application/insertbei",
    method: "post",
    data: JSON.stringify(map),
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}


//采购申请明细新增
// export function InsertPurchasedetails(purchasedetails) {
//   return request({
//     url: "/application/InsertPurchasedetails",
//     method: "post",
//     data: purchasedetails,
//     header: {
//       "Content-Type": "application/json", //如果写成contentType会报错
//     },
//   });
// }

export function SelectApplication(application) {
  return request({
    url: "/application/select",
    method: "post",
    params: application,
  });
}

export function SelectApplicationk(pageNum, pageSize) {
  return request({
    url: "/application/select?pageNum=" + pageNum + "&pageSize=" + pageSize,
    method: "get",
  });
}

export function SelectApplication2(map) {
  return request({
    url: "/application/UpdatePurchasedetails2",
    method: "POST",
    data: JSON.stringify(map),
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

//查询采购详细信息
export function SelectAll(map) {
  return request({
    url: "/application/selectAll",
    method: "POST",
    data: JSON.stringify(map),
    headers: {
      "Content-Type": "application/json",
    },
  });
}

//查询采购待审核状态
export function SelectApplicationAllQi(str) {
  return request({
    url: "/application/SelctaQi?str=" + str,
    method: "get",
  });
}

//查询申请采购详细信息
export function SelectOrderXi(code) {
  return request({
    url: "/application/SelectOrderXi?code=" + code,
    method: "get",
  });
}

//查询采购详细信息
export function SelectAll4(map) {
  return request({
    url: "/application/InsertOrder",
    method: "POST",
    data: JSON.stringify(map),
    headers: {
      "Content-Type": "application/json",
    },
  });
}

export function SelectListOrder(purchaseorder, pageNum, pageSize) {
  return request({
    url:
      "/application/SelectListOrder?pageNum=" +
      pageNum +
      "&pageSize=" +
      pageSize,
    method: "get",
    params: purchaseorder,
  });
}

//查询采购设备订单信息
export function SelectOrderAll(purchaseorder) {
  return request({
    url: "/application/SelectOrderAll",
    method: "post",
    params: purchaseorder,
  });
}

//查看
export function SelectAcceptanceList(acceptance) {
  return request({
    url: "/application/SelectAcceptanceList",
    method: "get",
    params: acceptance,
  });
}
